package com.gph.saviorframework.mq.api;

import com.gph.saviorframework.mq.api.order.OrderConsumer;
import com.gph.saviorframework.mq.api.order.OrderProducer;
import com.gph.saviorframework.mq.api.transaction.LocalTransactionChecker;
import com.gph.saviorframework.mq.api.transaction.TransactionProducer;

import java.util.Properties;

/**
 * Created by root on 16-7-10.
 */
public interface MQFactoryAPI {

    /**
     * 创建消息生产者
     * @param properties
     * @return
     */
    Producer createProducer(final Properties properties);

    /**
     * 创建消息消费者
     * @param properties
     * @return
     */
    Consumer createConsumer(final Properties properties);

    /**
     * 创建顺序消息生产者
     * @param properties
     * @return
     */
    OrderProducer createOrderProducer(final Properties properties);

    /**
     * 创建顺序消息消费者
     * @param properties
     * @return
     */
    OrderConsumer createOrderedConsumer(final Properties properties);

    /**
     * 创建事务处理的消息生产者
     * @param properties
     * @return
     */
    TransactionProducer createTransactionProducer(Properties properties,
                                                  final LocalTransactionChecker checker);
}
